package cn.fl.project.transform;

import cn.cmm.base.framework.utils.CollectionUtils;
import cn.fl.base.lnkcomp.transform.BasePrjLcApplyRlPsnVOTransform;
import cn.fl.project.vo.PrjLcApplyRlPsnVO;
import fl.spl.facade.lnkcomp.dto.PrjLcApplyRlPsnDTO;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 挂靠公司变更申请关联人员信息表 转换器
 * @Description: VO是客户端传递数据到服务端进行转换的数据
 * @Description: VO转换数据变成DTO传递到服务端
 * @Description: VO不能在服务端出现
 */
public class PrjLcApplyRlPsnVOTransform extends BasePrjLcApplyRlPsnVOTransform {


    /**
     * DTO 转  VO
     *
     * @param dto PrjLcApplyRlPsnDTO
     * @return PrjLcApplyRlPsnVO
     */
    public static PrjLcApplyRlPsnVO toVO(PrjLcApplyRlPsnDTO dto) {
        PrjLcApplyRlPsnVO vo = baseToVO(dto);
        return vo;
    }

    /**
     * VO 转 DTO
     *
     * @param vo PrjLcApplyRlPsnVO
     * @return PrjLcApplyRlPsnDTO
     */
    public static PrjLcApplyRlPsnDTO toDTO(PrjLcApplyRlPsnVO vo) {
        PrjLcApplyRlPsnDTO dto = baseToDTO(vo);
        return dto;
    }

    /**
     * DTO集合 转 VO集合
     *
     * @param list List<PrjLcApplyRlPsnDTO>
     * @return List<PrjLcApplyRlPsnVO>
     */
    public static List<PrjLcApplyRlPsnVO> toVOList(List<PrjLcApplyRlPsnDTO> list) {
        List<PrjLcApplyRlPsnVO> voList = new ArrayList<PrjLcApplyRlPsnVO>();
        if (CollectionUtils.isNotEmpty(list)) {
            for (PrjLcApplyRlPsnDTO dto : list) {
                voList.add(toVO(dto));
            }
        }
        return voList;
    }

    /**
     * VO集合 转 DTO集合
     *
     * @param list List<PrjLcApplyRlPsnVO>
     * @return List<PrjLcApplyRlPsnDTO>
     */
    public static List<PrjLcApplyRlPsnDTO> toDTOList(List<PrjLcApplyRlPsnVO> list) {
        List<PrjLcApplyRlPsnDTO> dtoList = new ArrayList<PrjLcApplyRlPsnDTO>();
        if (CollectionUtils.isNotEmpty(list)) {
            for (PrjLcApplyRlPsnVO vo : list) {
                dtoList.add(toDTO(vo));
            }
        }
        return dtoList;
    }
}
